package com.ity.teamanagement.controller;

import com.ity.teamanagement.annocation.CheckAuthorityStatus;
import com.ity.teamanagement.annocation.CheckLoginState;
import com.ity.teamanagement.result.Result;
import com.ity.teamanagement.service.HomeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author coderFu
 * @create 2021/6/2
 */
@RestController
@Api(tags = "后台首页可视化模块")
@RequestMapping("/home")
public class HomeController {

    @Autowired
    private HomeService homeService;

    @GetMapping("/teaGradeBarChart")
    @ApiOperation("茶省份等级柱状图")
    @CheckLoginState
    public Result teaGradeBarChart(){
        return Result.success(homeService.teaGradeBarChart());
    }

    @GetMapping("/teaRarePieChart")
    @ApiOperation("茶稀有品种饼状图")
    @CheckLoginState
    public Result teaRarePieChart(){
        return Result.success(homeService.teaRarePieChart());
    }

    @GetMapping("/findAllTeaTypeCount")
    @ApiOperation("查询茶种各类型数目")
    @CheckLoginState
    public Result findAllTeaType(){
        return Result.success(homeService.findAllTeaTypeCount());
    }



}
